package com.onyx.entity;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单明细order_detail
 * @TableName order_detail
 */
public class OrderDetail implements Serializable {
    /**
     * id
     */
    private Long id;

    /**
     * 订单的id
     */
    private Long orderId;

    /**
     * 产品id
     */
    private Long productId;

    /**
     * 产品编码
     */
    private String productCode;

    /**
     * 产品名字
     */
    private String productName;

    /**
     * 数量
     */
    private Object amount;

    /**
     * 单价
     */
    private BigDecimal univalent;

    /**
     * 总价
     */
    private BigDecimal totalPrice;

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    public Long getId() {
        return id;
    }

    /**
     * id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 订单的id
     */
    public Long getOrderId() {
        return orderId;
    }

    /**
     * 订单的id
     */
    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    /**
     * 产品id
     */
    public Long getProductId() {
        return productId;
    }

    /**
     * 产品id
     */
    public void setProductId(Long productId) {
        this.productId = productId;
    }

    /**
     * 产品编码
     */
    public String getProductCode() {
        return productCode;
    }

    /**
     * 产品编码
     */
    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    /**
     * 产品名字
     */
    public String getProductName() {
        return productName;
    }

    /**
     * 产品名字
     */
    public void setProductName(String productName) {
        this.productName = productName;
    }

    /**
     * 数量
     */
    public Object getAmount() {
        return amount;
    }

    /**
     * 数量
     */
    public void setAmount(Object amount) {
        this.amount = amount;
    }

    /**
     * 单价
     */
    public BigDecimal getUnivalent() {
        return univalent;
    }

    /**
     * 单价
     */
    public void setUnivalent(BigDecimal univalent) {
        this.univalent = univalent;
    }

    /**
     * 总价
     */
    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    /**
     * 总价
     */
    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrderDetail other = (OrderDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getProductCode() == null ? other.getProductCode() == null : this.getProductCode().equals(other.getProductCode()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getUnivalent() == null ? other.getUnivalent() == null : this.getUnivalent().equals(other.getUnivalent()))
            && (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getProductCode() == null) ? 0 : getProductCode().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getUnivalent() == null) ? 0 : getUnivalent().hashCode());
        result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderId=").append(orderId);
        sb.append(", productId=").append(productId);
        sb.append(", productCode=").append(productCode);
        sb.append(", productName=").append(productName);
        sb.append(", amount=").append(amount);
        sb.append(", univalent=").append(univalent);
        sb.append(", totalPrice=").append(totalPrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}